#include<stdio.h>
#include<assert.h>

typedef struct ListNode {
	int val;
	struct ListNode* next;
}LTN;

struct ListNode* reverseList(struct ListNode* head)
{
	LTN* pcur = head;
	LTN* newnode = NULL;
	while (pcur)
	{
		LTN* next = pcur->next;
		pcur->next = newnode;
		newnode = pcur;
		pcur = next;
	}
	
	return newnode;
	
}